﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using AmuTools;
using System.Data;
using System.Threading;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            TimerHelper.Run();
            TimerHelper.Add(state => {
                Console.WriteLine(state.BeginTime);
            }, 0);
            TimerHelper.Add(state => {
                Console.WriteLine(state.BeginTime);
                TimerHelper.Add(state2 => {
                    Console.WriteLine(state2.BeginTime);
                }, 2000);
            }, 2000);
            
            Console.ReadLine();
        }

        class ABC
        {
            public Type Type { get; set; }
            public object[] Columns { get; set; }

            public ABC(Type type, object[] columns)
            {
                this.Type = type;
                this.Columns = columns;
            }
        }

        static string query(dynamic func)
        {
            var obj = new { };
            func(obj);
            return "";
        }
        static string query2<T>(Func<T, SqlFuncs, string> func)
        {
            var obj = new { };
            return "";
        }

    }

    class SqlFuncs
    {
        public string isin(){
            return "";
        }
    }

    static class extendFunc
    {
        public static void PrintString(this String val)
        {
            Console.WriteLine(val);
        }
    }


    [Model(TableName = "t_admin", PrimaryKey = "id", IdentityInsert = true)]
    public class Admin
    {
        public int id { get; set; }

        public string username { get; set; }

        [Field(Webable = false, DataType = "varchar(50)")]
        public string password { get; set; }

        [Field(Webable = false)]
        public int role_id { get; set; }
        
        [Field(Webable = false)]
        public string special_permission { get; set; }
        

        public int status { get; set; }

        [Field(Webable = false)]
        public int is_delete { get; set; }
        

        [Field(Storageable = false)]
        public bool test { get; set; }

        [Field(Storageable = false)]
        public int is_must { get; set; }

        public static Admin[] GetInitData()
        {
            return new Admin[]{
                new Admin { username = "admin", password = "123456", role_id = 110001, is_must = 1 }
            };
        }
    }
}
